<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link href="${root!}/static/css/layout.css" rel="stylesheet"
	type="text/css" />
<link href="${root!}/static/css/skin.css" rel="stylesheet"
	type="text/css" />
<link href="${root!}/static/css/dialog.css" rel="stylesheet"
	type="text/css" />

<script src="${root!}/static/Js/jquery-1.4.2.js" type="text/javascript"></script>

<script src="${root!}/static/js/layout.js" type="text/javascript"></script>

<script src="${root!}/static/js/dialog.js" type="text/javascript"></script>

<script src="${root!}/static/js/form.js" type="text/javascript"></script>

<script>
	var RootPath = "${root!}";
	var FormCodeUrl = RootPath + "/form/formControl";
	//分页展示
	var FormQuery = "/query?parentNodeId=${parentNodeId!}&nodeId=${nodeId!}";
	var FormTableId = "GridView1";
	var TablePageSize = 10;
	//删除
	var FormDeleteMethod = "delete";
	$(function() {
		SearchPage(1);
	});

	function InsertClick() {
		var url = "${root!}/form/formControl/detail?parentNodeId=${parentNodeId!}&nodeId=${nodeId!}";
		OpenWindow(url, "表单管理", 800, 450, "1", "执行成功！", "执行失败！")
	}
	
	function UpdateClick() {
		
		var container = document.getElementById("content");
		var selectItem = CheckNumber(container);
		
		if (selectItem.length != 1) {
			Alert('请选择一项！');
			return false;
		} else {
			var url = "${root!}/form/formControl/detail?formControlId="+selectItem[0];
			OpenWindow(url, "控件管理", 800, 450, "1", "执行成功！", "执行失败！")
		}
	}

	function DeleteClick() {

		var container = document.getElementById("content");
		var selectItem = CheckNumber(container);

		if (selectItem.length == 0) {
			Alert('请至少选择一项！');
			return false;
		} else {
			Confirm('确定要执行删除操作？', function() {
				//确定
				var ret = DeleteForm(selectItem);
				if (ret == "1") {
					Success("删除成功！");
				}

			});
		}
	}
	
    function ResetClick() {
        location.href = location.href;
    }
</script>

</head>
<body>

	<form id="myform">
		<div class="container">
			<div class="hiddencalc fullheight w4"></div>
			<div class="fullheight calcwidth">
				<div class="fullwidth">
					<div class="buttonGroup h30">

						<input type="button" value="查询" id="btnSearch" onclick="SearchPage(1);" /> <input
							type="button" value="新增" id="btnInsert" onclick="InsertClick()" />
						<input type="button" value="修改" id="btnUpdate"
							onclick="UpdateClick()" /> <input type="button" value="删除"
							id="btnDelete" onclick="DeleteClick();" /> <input
							type="button" value="页面重置" id="btnReset" onclick="ResetClick()" />
					</div>
				</div>
				<div class="hiddencalc fullwidth h4"></div>
				<div class="formcontainer fullwidth">
					<div class="formitem halfwidth h30">
						<div class="label w150">
							<font class="labeltext">表单名称：</font>
						</div>
						<div class="control calcwidth">
							<input type="text" class="calcwidth" id="txtFormTitle"
								name="txtFormTitle" />
						</div>
					</div>
					<div class="formitem halfwidth h30">
						<div class="label w150">
							<font class="labeltext"></font>
						</div>
						<div class="control calcwidth"></div>
					</div>
				</div>
				<div class="hiddencalc fullwidth h4"></div>
				<div id="content" class="fullwidth calcheight onlyscrolly">
					<table style="border-collapse: collapse;" id="GridView1"
						class="showDataTable fullwidth" border="1" cellspacing="0">
						<tr class="showDataTitle">
							<th scope="col" style="width: 50px;">
								<p onclick="SelectAll('content');" style="cursor: hand">全选</p>
							</th>
							<th style="width: 50px;">序号</th>
							<th style="width: 120px;">控件标题</th>
							<th>归属</th>
							<th style="width: 70px;">最大长度</th>
							<th style="width: 70px;">输入验证</th>
							<th style="width: 70px;">控件类型</th>
							<th style="width: 70px;">顺序号</th>
						</tr>

						<tr class="showDataRow" style="display: none;">
							<td align="center"><input type="checkbox" value="{FormControlId}" /></td>
							<td align="center">{IndexNumber}</td>
							<td><a href="javascript:void(0);"
								onclick="OpenWindow('/form/formControl/detail?formControlId={FormControlId}', '控件管理', 800, 450, '1', '执行成功！', '执行失败！');">{FormControlTitle}</a></td>
							<td align="center"></td>
							<td align="center"></td>
							<td align="center"></td>
							<td align="center">{FormControlType}</td>
							<td align="center">{OrderNumber}
								<div class="sortButton">
									<div class="upButton" onclick="upAndDown('up','formDb','TS_Form_Control','FormControlId','{FormControlId}','{PreKeyId}','OrderNumber','{OrderNumber}','{PreValue}');"></div>
									<div class="downButton" onclick="upAndDown('down','formDb','TS_Form_Control','FormControlId','{FormControlId}','{NextKeyId}','OrderNumber','{OrderNumber}','{NextValue}');"></div>
								</div>
							</td>
						</tr>

					</table>
				</div>
				<div class="hiddencalc fullwidth h4"></div>
				<div class="fullwidth h30">
					<div id="displayPage"></div>
				</div>
				<div class="hiddencalc fullwidth h4"></div>
			</div>
			<div class="hiddencalc fullheight w4"></div>
		</div>
	</form>
</body>
</html>
